<div ng-controller="shopEditCtrl">
    <div class="bg-light lter b-b wrapper-md ng-scope">
        <h4 class="m-n font-thin">完善门店信息</h4>
        <button ui-sref="app.shop" class="btn-back btn btn-dark btn-sm btn-rounded">
            返回
        </button>
    </div>
    <div class="wrapper-md">
        <div class="panel panel-body padder-md">
            <!--商品类型-->
            <form name="shopEditForm" class="form-validation" ng-submit="editShop()">

                <div class="m-b-sm">
                    <div class="padder-md padder-v bg-light m-b">
                        <span class="font-bold m-r-xs text-muted"><p class="sp-step">1</p>店铺基本信息</span>
                    </div>
                    <div>
                        <div class="form-horizontal form-validation">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">店铺名称</label>
                                <div class="col-sm-4">
                                    <input type="text" name="shopName" ng-model="shopEditVO.name" class="form-control m-b-xs" placeholder="请输入店铺名称" required>
                                    <div ng-if="shopEditForm.shopName.$touched">
                                        <p ng-if="shopEditForm.shopName.$error.required" class="text-danger h6 m-t-sm">店铺名称是必需的</p>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">联系人电话</label>
                                <div class="col-sm-4">
                                    <input type="text" name="shopPhone" ng-model="shopEditVO.mobilePhone" class="form-control m-b-xs" placeholder="请输入联系人电话" ng-pattern="/^1[34578]\d{9}$/" required>
                                    <div ng-if="shopEditForm.shopPhone.$touched">
                                        <p ng-if="shopEditForm.shopPhone.$error.required" class="text-danger h6 m-t-sm">联系人电话是必需的</p>
                                        <p ng-if="shopEditForm.shopPhone.$error.pattern" class="text-danger h6 m-t-sm" >请填写正确的手机号</p>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">选择行业</label>
                                <div class="col-sm-4">
                                    <select class="input-sm form-control m-b-sm" ng-model="shopEditVO.industryId" name="industryId" ng-options="item.id as item.fullName for item in industry" required>
                                        <option value="">请选择分类</option>
                                    </select>
                                    <div ng-if="shopEditForm.industryId.$touched">
                                        <label class="pull-left text-left text-danger h6 l-h"  ng-if="shopEditForm.industryId.$error.required">请选择分类</label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">店铺归属地区</label>
                                <div class="col-sm-4">
                                    <div class="w-full text-left">
                                        <div class="w-full btn-group dropdown m-b-sm">
                                            <div ng-click="findProvinces(0,0)" name="address" class="w-full text-left form-control dropdown-toggle">
                                                {{selectProvice}}/{{selectTown}}/{{selectCounty}}
                                            </div>
                                        </div>
                                        <tabset class="tab-container h5 bg-white m-n" ng-if="showState">
                                            <tab heading="省" active="steps.step1">
                                                <div class="padder-md padder-v row" >
                                                    <div class="col-md-4 m-b-xs text-center" ng-repeat="item in provinces">
                                                        <div class="btn btn-sm" ng-click="findTown(1,item)">{{item.name}}</div>
                                                    </div>
                                                </div>
                                            </tab>
                                            <tab heading="市" active="steps.step2">
                                                <div class="padder-md padder-v row" >
                                                    <div class="col-md-4 m-b-xs text-center" ng-repeat="item in towns">
                                                        <div class="btn btn-sm" ng-click="findCounty(2,item)">{{item.name}}</div>
                                                    </div>
                                                    <div class="panel-body" ng-if="towns.length<=0">
                                                        - 请先选择省级 -
                                                    </div>
                                                </div>
                                            </tab>
                                            <tab heading="区" active="steps.step3">
                                                <div class="padder-md padder-v row" >
                                                    <div class="col-md-4 m-b-xs text-center" ng-repeat="item in countys">
                                                        <div class="btn btn-sm" ng-click="CountyHide(item)">{{item.name}}</div>
                                                    </div>
                                                    <div class="panel-body" ng-if="countys.length<=0">
                                                        - 请先选择市级 -
                                                    </div>
                                                </div>
                                            </tab>
                                        </tabset>
                                        <div>
                                            <span class="block text-danger h6" ng-if="!showState && currentState==0 && selectProvice == null">*请先选择省</span>
                                            <span class="block text-danger h6" ng-if="!showState && currentState==1 && selectTown == null">*请先选择市</span>
                                            <span class="block text-danger h6" ng-if="!showState && currentState==2 && selectCounty == null">*请先选择区</span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">自行添加商品</label>
                                <div class="col-sm-4">
                                    <div class="pull-left">
                                        <label class="i-switch m-t-xs m-r">
                                            <input type="checkbox"  ng-model="shopEditVO.isCustomGoods" ng-true-value="1" ng-false-value="0">
                                            <i></i>
                                        </label>
                                    </div>
                                    <label class="pull-left m-t-xs" ng-bind="{1:'允许',0:'不允许'}[shopEditVO.isCustomGoods]"></label>
                                </div>
                            </div>
                            <!--<div class="form-group">-->
                                <!--<label class="col-sm-1 control-label">是否直邮</label>-->
                                <!--<div class="col-sm-10">-->
                                    <!--<div class="pull-left">-->
                                        <!--<label class="i-switch m-t-xs m-r">-->
                                            <!--<input type="checkbox"  ng-model="shopEditVO.isMail" ng-true-value="1" ng-false-value="0">-->
                                            <!--<i></i>-->
                                        <!--</label>-->
                                    <!--</div>-->
                                    <!--<label class="pull-left m-t-xs" ng-bind="{1:'已开启',0:'未开启'}[shopEditVO.isMail]"></label>-->
                                <!--</div>-->
                            <!--</div>-->

                            <!--<div class="form-group">-->
                                <!--<label class="col-sm-1 control-label">是否到店</label>-->
                                <!--<div class="col-sm-10">-->
                                    <!--<div class="pull-left">-->
                                        <!--<label class="i-switch m-t-xs m-r">-->
                                            <!--<input type="checkbox"  ng-model="shopEditVO.isShop" ng-true-value="1" ng-false-value="0">-->
                                            <!--<i></i>-->
                                        <!--</label>-->
                                    <!--</div>-->
                                    <!--<label class="pull-left m-t-xs" ng-bind="{1:'已开启',0:'未开启'}[shopEditVO.isShop]"></label>-->
                                <!--</div>-->
                            <!--</div>-->

                            <div class="form-group">
                                <label class="col-sm-1 control-label">是否配送</label>
                                <div class="col-sm-10">
                                    <div class="pull-left">
                                        <label class="i-switch m-t-xs m-r">
                                            <input type="checkbox"  ng-model="shopEditVO.isDelivery" ng-true-value="1" ng-false-value="0" >
                                            <i></i>
                                        </label>
                                    </div>
                                    <label class="pull-left m-t-xs" ng-bind="{1:'已开启',0:'未开启'}[shopEditVO.isDelivery]"></label>
                                </div>
                            </div>

                            <!--<div class="form-group">-->
                                <!--<label class="col-sm-1 control-label">是否堂食</label>-->
                                <!--<div class="col-sm-10">-->
                                    <!--<div class="pull-left">-->
                                        <!--<label class="i-switch m-t-xs m-r">-->
                                            <!--<input type="checkbox"  ng-model="shopEditVO.isEat" ng-true-value="1" ng-false-value="0" >-->
                                            <!--<i></i>-->
                                        <!--</label>-->
                                    <!--</div>-->
                                    <!--<label class="pull-left m-t-xs" ng-bind="{1:'已开启',0:'未开启'}[shopEditVO.isEat]"></label>-->
                                <!--</div>-->
                            <!--</div>-->

                            <!--<div class="form-group">-->
                                <!--<label class="col-sm-1 control-label">是否预定</label>-->
                                <!--<div class="col-sm-10">-->
                                    <!--<div class="pull-left">-->
                                        <!--<label class="i-switch m-t-xs m-r">-->
                                            <!--<input type="checkbox"  ng-model="shopEditVO.isReserve" ng-true-value="1" ng-false-value="0">-->
                                            <!--<i></i>-->
                                        <!--</label>-->
                                    <!--</div>-->
                                    <!--<label class="pull-left m-t-xs" ng-bind="{1:'已开启',0:'未开启'}[shopEditVO.isReserve]"></label>-->
                                <!--</div>-->
                            <!--</div>-->
                            <div class="form-group" ng-if="check()">
                                <label class="col-sm-2 control-label text-danger h6 ">*请至少选择一项服务类型</label>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="w-full inline b-t">
                    <div class="col-sm-4 padder-v col-sm-offset-2">
                        <button type="submit" class="btn btn-success"  ng-disabled="shopEditForm.$invalid || check()">保存</button>
                    </div>
                </div>
            </form>


        </div>
    </div>
</div>